<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>wtf表单</title>
</head>
<body>
{% import 'base_macro.html' as func %}
<form method="post">
    {{ func.input('用户名：',name='username') }}<br>
    {{ func.input('密码：', type='password' ,name='password') }}<br>
    {{ func.input('用户名：', type = 'password',name='password2') }}<br>
    {{ func.input(type='submit',value='注册') }}<br>

    {% for msg in get_flashed_messages() %}
        {{ msg }}
    {% endfor %}
</form>
<h4>WTF表单的使用</h4>
<form method="post">
{#wtf表单提供了CSRF的验证功能#}
    {{ form.csrf_token }}
    {{ form.username.label }}{{ form.username }}<br>
    {{ form.password.label }}{{ form.password }}<br>
    {{ form.password2.label }}{{ form.password2 }}<br>
    {{ form.submit }}<br>
    {% for msg in get_flashed_messages() %}
        {{ msg }}
    {% endfor %}
</form>
</body>
</html>